const router = require('koa-router')();
const {productsModel} = require('../model/product');
// 获取新闻
router.get('/product', async (ctx, next) => {
    await productsModel.getProduct(ctx);
});
// 增加新闻
router.post('/add/product', async (ctx, next) => {
    await productsModel.addProduct(ctx);
});
// 删除新闻
router.post('/delete/product', async (ctx, next) => {
    await productsModel.deleteProduct(ctx);
});
// 编辑新闻
router.post('/edit/product', async (ctx, next) => {
    await productsModel.editProduct(ctx);
});
module.exports = router;